<script>
//    var router_url = "<?php echo Router::url(array('controller'=>'','action'=>''));?>";
//    
//    function routerUrl(controller, action, parameters)
//    {
//        full_url = "http://localhost"+router_url+"/"+controller+"/"+action+"/"+parameters;
//        return full_url;
//    }
//    
//    function abrePagina(url)
//    {
//        $.ajax({
//            cache: false,
//            type: 'GET',
//            dataType: 'HTML', 
//            url: url,
//            data: { name: "John", location: "Boston" }
//            }).done(function( msg ) {
//                $('.alvo').html(msg);
//        });
//    }
//
//    $(document).ready(function(){
//        abrePagina(routerUrl('pages','edit',1));
//    });

</script>

<section id="typography">
  <div class="page-header">
    <h1>Gerenciador <small>páginas, fotos, vídeos, agenda e o conteúdo que precisar</small></h1>
  </div>
    
    <?php echo $this->element('_admin/management_menu'); ?>

  <!-- Headings & Paragraph Copy -->
    <div class="row">
        <?php echo $this->element('_admin/pages/management_side'); ?>

        <div class="span8">
            <h3><?=$this->data['Page']['title'];?></h3>
            <?php echo $this->element('_admin/flash_messages'); ?>
            <div class="alvo">
                <? echo $this->Form->create('Page', array('class'=>'well')); ?>
                <?php 
                    echo($this->Form->input('Page.id'));
                    echo $this->Tinymce->input('Page.content', array( 
                        'label' => 'Conteúdo' 
                        ),array( 
                            'language'=>'en' 
                        ), 
                        'bbcode' 
                    ); 
                ?> 
                    <br/>
                    <label>Status</label>
                    <div class="make-switch" data-on="success" data-off="default">
                        <? echo $this->Form->checkbox('type', array('hiddenField' => false)); ?>
                    </div>
                    
                    
                    <p class="help-block"><br/>
                        <button type="submit" class="btn btn-success">Salvar</button>
                        <button type="submit" class="btn btn-danger">Deletar</button>
                    </p>

                <? echo $this->Form->end(); ?>
            </div>
        </div>
    </div>
</section>